package com.smartystars.quizzerServer;

import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;





public class DownloadableQuestions implements Serializable{
	

	private ArrayList<Question> downloadedQuestions;
	
	public  DownloadableQuestions(ArrayList<Question> downloadedQuestions){
		this.downloadedQuestions = downloadedQuestions;
	}
	
	public ArrayList<Question> getQuestions(){
		return downloadedQuestions;
	}
	
	public ArrayList<Question> getThemedQuestions(String TAG){
		ArrayList<Question> qreturn = new ArrayList<Question>();
		
		for(Question q : downloadedQuestions){
			if(q.getKey().equals(TAG)){
				qreturn.add(q);
			}
		}
		
		return qreturn;
		
	}
	
	
	
	public ArrayList<String> getThemes(){
		ArrayList<String> themes = new ArrayList<String>();
		
		for(Question q : downloadedQuestions){
			String temp = (String) q.getKey();
			if(!themes.contains(temp)){
				themes.add(temp);
			}
		}
		return themes;
		
		
	}

}
